package com.ruoyi.common.enums;

import org.apache.commons.lang3.StringUtils;

public enum RoleCodeEnum {


    SUPER_ADMIN("admin", "超级管理员"),
    TENANT_ADMIN("tenant_admin", "租户管理员"),
    ;

    /**
     * 角色编码
     */
    private final String code;
    /**
     * 名字
     */
    private final String name;

    RoleCodeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static boolean isSuperAdmin(String code) {
        return StringUtils.equals(code, SUPER_ADMIN.getCode());
    }

}
